// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import axios from 'axios';
Vue.prototype.axios = axios
import $cookies from 'vue-cookies'

import vueWechatTitle from 'vue-wechat-title';
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

import "./assets/basejs/base"



import common from "./assets/basejs/common"
Vue.prototype.common = common;
console.log('查看commom都有什么',Vue.prototype.common)

Vue.use($cookies)
Vue.use(ElementUI)
// cnpm install vue-wechat-title --save
axios.defaults.withCredentials = true;

Vue.config.productionTip = false
Vue.use(vueWechatTitle);

import VueAliplayerV2 from 'vue-aliplayer-v2';
Vue.use(VueAliplayerV2);

import api from "./assets/basejs/config"
//以后的this.api.config   就是配置文件里面的自动设置信息

Vue.prototype.api = api;
// let startApp = function() {
var url = "";
console.log(process.env.NODE_ENV)
if (process.env.NODE_ENV == "dev") {
    url = '/static/config-dev.json';
} else if (process.env.NODE_ENV == "test") {
    url = '/static/config-test.json';
} else if (process.env.NODE_ENV == "prod") {
    url = '/static/config-prod.json';
}

axios.get(url).then(function(res) {
    console.log("查看封装好的baseurl 等各种配置",res.data);
    api.setConfig(res.data);
});

var vue = new Vue({
    el: '#app',
    router,
    components: {
        App
    },
    template: '<App/>'
});
import $sdk from "hammer-base-sdk"
Vue.prototype.$sdk = $sdk(vue);
console.log("琛哥封装的方法",Vue.prototype.$sdk)
